package user;

import book.BookList;
import iooperation.*;


import java.util.Scanner;

public class AdminUser extends User {


    public AdminUser(String name) {
        super(name);
        this.iOperations = new IOperation[]{
                new SearchOperation(),
                new SearchOperation(),
                new AddOpearation(),
                new DeleteOperation(),
                new ShowOperation(),
                new ExitOperation()
        };
    }

    @Override
    public void dooperation(int choice, BookList bookList) {
        this.iOperations[choice].work(bookList);
    }

    public int  menu() {
        System.out.println("**欢迎" + super.name + "****");
        System.out.println("******管理员菜单*******");
        System.out.println("*****1. 查找图书**********");
        System.out.println("*****2. 新增图书************");
        System.out.println("*****3. 删除图书***********");
        System.out.println("*****4. 显示图书***********");
        System.out.println("*****5. 退出系统***********");
        System.out.println("请选择你要执行的操作！");
        return   new Scanner(System.in).nextInt();
    }
}

